import request from "@/utils/request";

/**
 * 获取仓库列表
 * @param params
 * @returns {Promise<unknown>}
 */
export function getWarehouseList(params){
  return request({
    url: '/warehouse/getWarehouseList',
    method: 'get',
    params,
  })
}


/**
 * 获取仓库的信息
 * @param id
 * @returns {Promise | Promise<unknown>}
 */
export function getWarehouseInfo(id){
  return request({
    url: `/warehouse/getWarehouseInfo/${id}`,
    method: 'get',
  })
}


/**
 * 保存仓库信息
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export function saveWarehouse(data){
  return request({
    url: '/warehouse/saveWarehouse',
    method: 'post',
    data,
    handleError: true,
  })
}

/**
 * 删除仓库
 * @param id
 * @returns {Promise | Promise<unknown>}
 */
export function delWarehouse(id){
  return request({
    url: '/warehouse/delWarehouse/' + id,
    method: 'delete',
  })
}

/**
 * 获取国内仓
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export function getFlWarehouseList(params = {}){
  return request({
    url: '/warehouse/getFlWarehouseList',
  })
}
